// import com.alibaba.druid.sql.ast.*;
// import com.alibaba.druid.sql.ast.expr.SQLPropertyExpr;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

// import java.util.ArrayList;
// import java.util.List;
#pragma once
#include "../SQLStatementImpl.h"
#include "../SQLObjectWithDataType.h"
#include "SQLCreateStatement.h"

class SQLCreateFunctionStatement
 : public SQLStatementImpl,
  virtual public SQLCreateStatement,
   virtual public SQLObjectWithDataType
{
public:
  SQLName_ptr definer;

  BOOL_ptr create = BOOL::TRUE;
  BOOL_ptr orReplace;
  SQLName_ptr name;
  SQLStatement_ptr block;
  SQLParameter_list_ptr parameters;

  // for oracle
  string_ptr javaCallSpec;

  SQLName_ptr authid;

  SQLDataType_ptr returnDataType;

  // for mysql

  string_ptr comment;
  BOOL_ptr deterministic;
  BOOL_ptr parallelEnable;
  BOOL_ptr aggregate;
  SQLName_ptr using_;
  BOOL_ptr pipelined;
  BOOL_ptr resultCache;
  string_ptr wrappedSource;
  string_ptr language;
  BOOL_ptr temporary;
  BOOL_ptr ifNotExists;

  SQLCreateFunctionStatement();
  SHAREDOBJECT(SQLCreateFunctionStatement);

  SQLObject_ptr clone();

  // @Override
  void accept0(SQLASTVisitor_ptr visitor);

  SQLParameter_list_ptr getParameters();

  void setParameters(SQLParameter_list_ptr parameters);

  SQLName_ptr getName();

  void setName(SQLName_ptr x);

  SQLStatement_ptr getBlock();

  void setBlock(SQLStatement_ptr block);

  SQLName_ptr getAuthid();

  void setAuthid(SQLName_ptr authid);

  string_ptr getLanguage();

  void setLanguage(string_ptr language);

  BOOL_ptr isOrReplace();

  void setOrReplace(BOOL_ptr orReplace);

  SQLName_ptr getDefiner();

  void setDefiner(SQLName_ptr definer);

  BOOL_ptr isCreate();

  void setCreate(BOOL_ptr create);

  string_ptr getJavaCallSpec();

  void setJavaCallSpec(string_ptr javaCallSpec);

  SQLDataType_ptr getReturnDataType();

  void setReturnDataType(SQLDataType_ptr returnDataType);

  string_ptr getComment();

  void setComment(string_ptr comment);

  BOOL_ptr isDeterministic();

  void setDeterministic(BOOL_ptr deterministic);

  string_ptr getSchema();

  // @Override
  SQLDataType_ptr getDataType();

  // @Override
  void setDataType(SQLDataType_ptr dataType);

  BOOL_ptr isParallelEnable();

  void setParallelEnable(BOOL_ptr parallel_enable);

  BOOL_ptr isAggregate();

  void setAggregate(BOOL_ptr aggregate);

  SQLName_ptr getUsing();

  void setUsing(SQLName_ptr using_);

  BOOL_ptr isPipelined();

  void setPipelined(BOOL_ptr pipelined);

  BOOL_ptr isResultCache();

  void setResultCache(BOOL_ptr resultCache);

  string_ptr getWrappedSource();

  void setWrappedSource(string_ptr wrappedSource);

  BOOL_ptr isTemporary();

  void setTemporary(BOOL_ptr temporary);

  BOOL_ptr isIfNotExists();

  void setIfNotExists(BOOL_ptr ifNotExists);
};
